/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-05-03
 * 23:21
 */
public class Test {
    public static void main(String[] args) {
        for (int i=0;i<100000;i++){
            int n=0;
            int count=0;
            int tem=i;
            while (tem!=0){
               count++;
               tem/=10;
            }
            tem=i;
            while (tem!=0){
                n+=Math.pow(tem%10,count);
                tem/=10;
            }
            if(n==i){
                System.out.println(i);
            }
        }
    }
}
